package top.juntower.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.juntower.dao.UserMapper;
import top.juntower.pojo.Feedback;
import top.juntower.pojo.User;
import top.juntower.pojo.dto.HistoryDto;
import top.juntower.service.UserService;

import java.util.List;
import java.util.Map;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private  UserMapper userMapper;


    @Override
    public User queryUser(Map map) {
        return userMapper.queryUser(map);
    }

    @Override
    public int queryEmail(String userEmail) {
        return userMapper.queryEmail(userEmail);
    }

    @Override
    public int register(Map map) {
        return userMapper.register(map);
    }

    @Override
    public User queryUserInfo(Integer userId) {
        return userMapper.queryUserInfo(userId);
    }

    @Override
    public int updateUserImg(Map map) {
        return userMapper.updateUserImg(map);
    }

    @Override
    public List<HistoryDto> queryHistory(Integer userId) {
        return userMapper.queryHistory(userId);
    }

    @Override
    public int insertHistory(Map map) {
        return userMapper.insertHistory(map);
    }

    @Override
    public int deleteHistory(Integer hId) {
        return userMapper.deleteHistory(hId);
    }

    @Override
    public int deleteUserIdHistory(Integer userId) {
        return userMapper.deleteUserIdHistory(userId);
    }

    @Override
    public int updateUserName(Map map) {
        return userMapper.updateUserName(map);
    }

    @Override
    public int deleteMoreUserIdHistory(List<Integer> list) {
        return userMapper.deleteMoreUserIdHistory(list);
    }

    @Override
    public List<User> queryUserList(Integer pageNum, Integer pageSize) {
        return userMapper.queryUserList(pageNum,pageSize);
    }

    @Override
    public List<User> queryLikeUserList(String likeKeywords,Integer pageNum,Integer pageSize) {
        return userMapper.queryLikeUserList(likeKeywords,pageNum,pageSize);
    }

    @Override
    public int addFeedback(Map map) {
        return userMapper.addFeedback(map);
    }

    @Override
    public List<Feedback> queryFeedback(Integer pageNum, Integer pageSize) {
        return userMapper.queryFeedback(pageNum,pageSize);
    }

    @Override
    public int deleteUser(Integer userId, Integer userState) {
        return userMapper.deleteUser(userId, userState);
    }

    @Override
    public int updatePassword(Map map) {
        return userMapper.updatePassword(map);
    }


}
